<%@page import="com.liferay.portal.service.UserLocalServiceUtil"%>
<%@page import="com.liferay.portal.kernel.util.ListUtil"%>
<%@ taglib uri="http://liferay.com/tld/aui" prefix="aui"%>
<%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui"%>
<%@page import="com.liferay.portal.kernel.language.LanguageUtil"%>
<%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet"%>
<%@page import="com.liferay.portal.theme.ThemeDisplay"%>
<%@ include file="/html/quangcao_admin/init.jsp"%>
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ page pageEncoding="UTF-8"%>
<%@ include file="/html/quangcao_admin/init.jsp"%>
<portlet:defineObjects />

<portlet:renderURL var="createURL">
	<portlet:param name="jspPage" value="/html/quangcao_admin/create.jsp" />
</portlet:renderURL>

<portlet:actionURL name="searchQuangCao" var="searchBannerURL">

</portlet:actionURL>

<div id="formSearchQuangCao"  >
	<form class="edit" action="<%=searchBannerURL.toString()%>" name="searchQuangCao" method="post">
		<h2>Tìm kiếm</h2>
		<div>
			<label>Loại tìm kiếm </label> 
			<select id="selectsearch">
				<option value="">Tất cả</option>
				<option value="">Chi tiết</option>
				<option value="">Nhiều tiêu chí</option>
			</select>
		</div>
		
		<div style="clear: both;" class="formSearchQuangCaoLeft">
			<div>
				<label>ID</label> 
				<input name="quangCaoId" size="30" class="pencil" type="text" />
			</div>
			
			<div>
				<label>Loại quảng cáo</label> 
				<input name="type" size="30" class="pencil"	type="text" />
			</div>
			<div>
				<label>Tiêu đề</label> 
				<input name="Title" size="30" class="pencil" type="text" />
			</div>
		</div>
		<div class="buttons">
			<input class="orangebutton" type="submit" value="Search" />
		</div>
	</form>
</div>

<a href="<%=createURL.toString()%>"> <input type="button"
	value="Tạo quảng cáo" />
</a>

<liferay-ui:search-container emptyResultsMessage="no-result" delta="10">
	<liferay-ui:search-container-results>
		<%
			List<QuangCao_banner> bannerQuangcao = QuangCao_bannerLocalServiceUtil
							.getQuangCao_banners(QueryUtil.ALL_POS,
									QueryUtil.ALL_POS);
					results = ListUtil.subList(bannerQuangcao,
							searchContainer.getStart(),
							searchContainer.getEnd());
					total = bannerQuangcao.size();

					pageContext.setAttribute("results", results);
					pageContext.setAttribute("total", total);
		%>
	</liferay-ui:search-container-results>
	<liferay-ui:search-container-row
		className="com.mto.quangcao.model.QuangCao_banner"
		modelVar="QuangCao_banner" keyProperty="quangCaoId">

		<liferay-ui:search-container-column-text name="ID"
			value="<%=String.valueOf(QuangCao_banner
								.getQuangCaoId())%>">
		</liferay-ui:search-container-column-text>

		<liferay-ui:search-container-column-text name="Tiêu đề quảng cáo"
			value="<%=QuangCao_banner.getTitle()%>"></liferay-ui:search-container-column-text>

		<liferay-ui:search-container-column-text name="Khách hàng"
			value="<%=UserLocalServiceUtil.getUser(
								QuangCao_banner.getUserId()).getScreenName()%>">
		</liferay-ui:search-container-column-text>

		<liferay-ui:search-container-column-text name="Loại quảng cáo"
			value="<%=QuangCao_banner.getType()%>">
		</liferay-ui:search-container-column-text>

		<liferay-ui:search-container-column-jsp
			path="/html/quangcao_admin/admin_action.jsp" align="right">
		</liferay-ui:search-container-column-jsp>

	</liferay-ui:search-container-row>
	<liferay-ui:search-iterator></liferay-ui:search-iterator>
</liferay-ui:search-container>

